package edu.isistan.matching.filters;

import edu.isistan.matching.IMatchingAlgorithm;
import edu.isistan.matching.filters.io.ComposedParameter;
import edu.isistan.matching.filters.io.MatchingMap;
import edu.isistan.metamodel.Interface;

/**
 * Filtro que ejecuta el algoritmo de matching estructural
 * @author Mariano
 *
 */
public class StructuralMatchingFilter implements IMatchingFilter<ComposedParameter<Interface, Interface>, MatchingMap> {

	/**
	 * Implementacion particular del algoritmo de matching estructural
	 */
	private IMatchingAlgorithm algorithm = null;

	public StructuralMatchingFilter(IMatchingAlgorithm algorithm) {
		super();
		this.algorithm = algorithm;
	}

	public MatchingMap process(ComposedParameter<Interface, Interface> parameter) {
		return this.algorithm.compareInterfaces(parameter.getParameter1(), parameter.getParameter2());
	}
}
